//
//  LocationUtil.m
//  IceBreaker
//
//  Created by Chiao Wolfire on 12-10-2.
//  Copyright (c) 2012年 NDS. All rights reserved.
//

#import "LocationUtil.h"
#import "PublicUtils.h"

@implementation LocationUtil

+(void) currentLocation {
    CLLocationManager *locationMgr = nil;
    if (locationMgr == nil) {
        locationMgr = [[[CLLocationManager alloc] init] autorelease];
    }
    
    if ([CLLocationManager locationServicesEnabled]) {
        locationMgr.delegate = nil;// set the delegate
        locationMgr.desiredAccuracy = kCLLocationAccuracyBest;// set the accuracy (best)
        locationMgr.distanceFilter = kCLDistanceFilterNone;
        [locationMgr startUpdatingLocation];// start to update the location
    } else {
        [PublicUtils alertMsgWithTitle: NSLocalizedStringFromTable(@"Alert tips", @"Localizable", @"Tips") 
                               message: NSLocalizedStringFromTable(@"Location disabled", @"Localizable", @"Location service is disabled")  
                     cancelButtonTitle: NSLocalizedStringFromTable(@"Confirm text", @"Localizable", @"OK")];
    }
}

-(void) locationManager: (CLLocationManager *)manager 
     didUpdateToLocation: (CLLocation *)newLocation 
            fromLocation: (CLLocation *)oldLocation {
    
}

@end
